package com.battery.netty;

import static ch.qos.logback.core.joran.action.ActionConst.NULL;

public class A {
    /**
     *  类似数据传输的示范数据
     * "ACT:check;ERRORCODE:0;ERRMSG:none;STATIONID:123456\r\n"
     *
     *
     *
     */

    private String ACT;              //登录请求
    private String STATIONID;        //设备编号
    private String MAC;              //设备物理地址
    private String USABLE_BATTERY;   //可借数量
    private String EMPTY_SLOT_COUNT; //可还数量
    private String TOTAL;            //卡槽总数
    private String TIMESTAMP;        //时间戳
    private String B01ID,B02ID,B03ID;            //电池ID
    private String B01POWER,B02POWER,B03POWER;      //电量
    private String B01SLOTSTATUS,B02SLOTSTATUS,B03SLOTSTATUS ;      //槽位状态
    private String ID;               //电源id
    private String SLOT;            //槽位
    private String ORDERID;          //订单id
    private String STATUS;          //借出状态

    A(){
        ACT = NULL;STATIONID = NULL;MAC = NULL;USABLE_BATTERY = NULL;EMPTY_SLOT_COUNT = NULL;TOTAL = NULL;TIMESTAMP = NULL;B01ID = NULL;B02ID = NULL;B03ID = NULL;
        B01POWER = NULL;B02POWER = NULL;B03POWER = NULL;B01SLOTSTATUS = NULL;B02SLOTSTATUS = NULL;B03SLOTSTATUS = NULL;ID = NULL;SLOT = NULL;ORDERID = NULL; STATUS = NULL;
    }
    public boolean login(){
        if (ACT.equals("login") && !STATIONID.isEmpty() && !MAC.isEmpty())
            return true;
        return false;
    }

    public boolean sync_setting(){
        if (ACT.equals("sync_setting") && !STATIONID.isEmpty() && !USABLE_BATTERY.isEmpty() && !EMPTY_SLOT_COUNT.isEmpty() && !TOTAL.isEmpty() && !TIMESTAMP.isEmpty())
            return true;
        return false;
    }

    public boolean heartbeat(){
        if (ACT.equals("heartbeat") && !STATIONID.isEmpty())
            return true;
        return false;
    }

    public boolean sync_battery(){
        if (ACT.equals("sync_battery") && !STATIONID.isEmpty() && !USABLE_BATTERY.isEmpty() && !EMPTY_SLOT_COUNT.isEmpty() && (!B01ID.isEmpty()||!B02ID.isEmpty()||!B03ID.isEmpty()) && (!B01POWER.isEmpty()||!B02POWER.isEmpty()||!B03POWER.isEmpty()) &&(!B01SLOTSTATUS.isEmpty()||!B02SLOTSTATUS.isEmpty()||!B03SLOTSTATUS.isEmpty()))
            return true;
        return false;
    }

    public boolean return_back(){
        if (ACT.equals("return_back") && !STATIONID.isEmpty() && !USABLE_BATTERY.isEmpty() && !EMPTY_SLOT_COUNT.isEmpty() && !ID.isEmpty() && !SLOT.isEmpty() && !STATUS.isEmpty() && !TIMESTAMP.isEmpty())
            return true;
        return false;
    }

    public String getB02ID() {
        return B02ID;
    }

    public void setB02ID(String b02ID) {
        B02ID = b02ID;
    }

    public String getB03ID() {
        return B03ID;
    }

    public void setB03ID(String b03ID) {
        B03ID = b03ID;
    }

    public String getB02POWER() {
        return B02POWER;
    }

    public void setB02POWER(String b02POWER) {
        B02POWER = b02POWER;
    }

    public String getB03POWER() {
        return B03POWER;
    }

    public void setB03POWER(String b03POWER) {
        B03POWER = b03POWER;
    }

    public String getB01SLOTSTATUS() {
        return B01SLOTSTATUS;
    }

    public void setB01SLOTSTATUS(String b01SLOTSTATUS) {
        B01SLOTSTATUS = b01SLOTSTATUS;
    }

    public String getB02SLOTSTATUS() {
        return B02SLOTSTATUS;
    }

    public void setB02SLOTSTATUS(String b02SLOTSTATUS) {
        B02SLOTSTATUS = b02SLOTSTATUS;
    }

    public String getB03SLOTSTATUS() {
        return B03SLOTSTATUS;
    }

    public void setB03SLOTSTATUS(String b03SLOTSTATUS) {
        B03SLOTSTATUS = b03SLOTSTATUS;
    }

    public String getSLOT() {
        return SLOT;
    }

    public void setSLOT(String SLOT) {
        this.SLOT = SLOT;
    }

    public String getACT() {
        return ACT;
    }

    public void setACT(String ACT) {
        this.ACT = ACT;
    }

    public String getSTATIONID() {
        return STATIONID;
    }

    public void setSTATIONID(String STATIONID) {
        this.STATIONID = STATIONID;
    }

    public String getMAC() {
        return MAC;
    }

    public void setMAC(String MAC) {
        this.MAC = MAC;
    }

    public String getUSABLE_BATTERY() {
        return USABLE_BATTERY;
    }

    public void setUSABLE_BATTERY(String USABLE_BATTERY) {
        this.USABLE_BATTERY = USABLE_BATTERY;
    }

    public String getEMPTY_SLOT_COUNT() {
        return EMPTY_SLOT_COUNT;
    }

    public void setEMPTY_SLOT_COUNT(String EMPTY_SLOT_COUNT) {
        this.EMPTY_SLOT_COUNT = EMPTY_SLOT_COUNT;
    }

    public String getTOTAL() {
        return TOTAL;
    }

    public void setTOTAL(String TOTAL) {
        this.TOTAL = TOTAL;
    }

    public String getTIMESTAMP() {
        return TIMESTAMP;
    }

    public void setTIMESTAMP(String TIMESTAMP) {
        this.TIMESTAMP = TIMESTAMP;
    }

    public String getB01ID() {
        return B01ID;
    }

    public void setB01ID(String b01ID) {
        B01ID = b01ID;
    }

    public String getB01POWER() {
        return B01POWER;
    }

    public void setB01POWER(String b01POWER) {
        B01POWER = b01POWER;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getORDERID() {
        return ORDERID;
    }

    public void setORDERID(String ORDERID) {
        this.ORDERID = ORDERID;
    }

    public String getSTATUS() {
        return STATUS;
    }

    public void setSTATUS(String STATUS) {
        this.STATUS = STATUS;
    }
}
